3.339 \(\int \frac{\tan (e+f x)}{a+b \sec ^2(e+f x)} \, dx\)

Optimal. Leaf size=23 \[ -\frac{\log \left (a \cos ^2(e+f x)+b\right )}{2 a f} \]

[Out]

-Log[b + a*Cos[e + f*x]^2]/(2*a*f)

________________________________________________________________________________________

Rubi [A]  time = 0.0308976, antiderivative size = 23, normalized size of antiderivative = 1., number of steps used = 2, number of rules used = 2, integrand size = 21, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.095, Rules used = {4138, 260} \[ -\frac{\log \left (a \cos ^2(e+f x)+b\right )}{2 a f} \]

Antiderivative was successfully verified.

[In]

Int[Tan[e + f*x]/(a + b*Sec[e + f*x]^2),x]

[Out]

-Log[b + a*Cos[e + f*x]^2]/(2*a*f)

Rule 4138

Int[((a_) + (b_.)*sec[(e_.) + (f_.)*(x_)]^(n_))^(p_.)*tan[(e_.) + (f_.)*(x_)]^(m_.), x_Symbol] :> Module[{ff =
 FreeFactors[Cos[e + f*x], x]}, -Dist[(f*ff^(m + n*p - 1))^(-1), Subst[Int[((1 - ff^2*x^2)^((m - 1)/2)*(b + a*
(ff*x)^n)^p)/x^(m + n*p), x], x, Cos[e + f*x]/ff], x]] /; FreeQ[{a, b, e, f, n}, x] && IntegerQ[(m - 1)/2] &&
IntegerQ[n] && IntegerQ[p]

Rule 260

Int[(x_)^(m_.)/((a_) + (b_.)*(x_)^(n_)), x_Symbol] :> Simp[Log[RemoveContent[a + b*x^n, x]]/(b*n), x] /; FreeQ
[{a, b, m, n}, x] && EqQ[m, n - 1]

Rubi steps

\begin{align*} \int \frac{\tan (e+f x)}{a+b \sec ^2(e+f x)} \, dx &=-\frac{\operatorname{Subst}\left (\int \frac{x}{b+a x^2} \, dx,x,\cos (e+f x)\right )}{f}\\ &=-\frac{\log \left (b+a \cos ^2(e+f x)\right )}{2 a f}\\ \end{align*}

Mathematica [A]  time = 0.173116, size = 26, normalized size = 1.13 \[ -\frac{\log (a \cos (2 (e+f x))+a+2 b)}{2 a f} \]

Antiderivative was successfully verified.

[In]

Integrate[Tan[e + f*x]/(a + b*Sec[e + f*x]^2),x]

[Out]

-Log[a + 2*b + a*Cos[2*(e + f*x)]]/(2*a*f)

________________________________________________________________________________________

Maple [A]  time = 0.025, size = 37, normalized size = 1.6 \begin{align*} -{\frac{\ln \left ( a+b \left ( \sec \left ( fx+e \right ) \right ) ^{2} \right ) }{2\,fa}}+{\frac{\ln \left ( \sec \left ( fx+e \right ) \right ) }{fa}} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(tan(f*x+e)/(a+b*sec(f*x+e)^2),x)

[Out]

-1/2/f/a*ln(a+b*sec(f*x+e)^2)+1/f/a*ln(sec(f*x+e))

________________________________________________________________________________________

Maxima [A]  time = 1.08854, size = 35, normalized size = 1.52 \begin{align*} -\frac{\log \left (a \sin \left (f x + e\right )^{2} - a - b\right )}{2 \, a f} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(tan(f*x+e)/(a+b*sec(f*x+e)^2),x, algorithm="maxima")

[Out]

-1/2*log(a*sin(f*x + e)^2 - a - b)/(a*f)

________________________________________________________________________________________

Fricas [A]  time = 0.508049, size = 51, normalized size = 2.22 \begin{align*} -\frac{\log \left (a \cos \left (f x + e\right )^{2} + b\right )}{2 \, a f} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(tan(f*x+e)/(a+b*sec(f*x+e)^2),x, algorithm="fricas")

[Out]

-1/2*log(a*cos(f*x + e)^2 + b)/(a*f)

________________________________________________________________________________________

Sympy [A]  time = 15.8197, size = 128, normalized size = 5.57 \begin{align*} \begin{cases} \frac{\tilde{\infty } x \tan{\left (e \right )}}{\sec ^{2}{\left (e \right )}} & \text{for}\: a = 0 \wedge b = 0 \wedge f = 0 \\\frac{\log{\left (\tan ^{2}{\left (e + f x \right )} + 1 \right )}}{2 a f} & \text{for}\: b = 0 \\\frac{x \tan{\left (e \right )}}{a + b \sec ^{2}{\left (e \right )}} & \text{for}\: f = 0 \\- \frac{1}{2 b f \sec ^{2}{\left (e + f x \right )}} & \text{for}\: a = 0 \\- \frac{\log{\left (- i \sqrt{a} \sqrt{\frac{1}{b}} + \sec{\left (e + f x \right )} \right )}}{2 a f} - \frac{\log{\left (i \sqrt{a} \sqrt{\frac{1}{b}} + \sec{\left (e + f x \right )} \right )}}{2 a f} + \frac{\log{\left (\tan ^{2}{\left (e + f x \right )} + 1 \right )}}{2 a f} & \text{otherwise} \end{cases} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(tan(f*x+e)/(a+b*sec(f*x+e)**2),x)

[Out]

Piecewise((zoo*x*tan(e)/sec(e)**2, Eq(a, 0) & Eq(b, 0) & Eq(f, 0)), (log(tan(e + f*x)**2 + 1)/(2*a*f), Eq(b, 0
)), (x*tan(e)/(a + b*sec(e)**2), Eq(f, 0)), (-1/(2*b*f*sec(e + f*x)**2), Eq(a, 0)), (-log(-I*sqrt(a)*sqrt(1/b)
 + sec(e + f*x))/(2*a*f) - log(I*sqrt(a)*sqrt(1/b) + sec(e + f*x))/(2*a*f) + log(tan(e + f*x)**2 + 1)/(2*a*f),
 True))

________________________________________________________________________________________

Giac [B]  time = 1.39131, size = 186, normalized size = 8.09 \begin{align*} -\frac{\frac{\log \left (a + b + \frac{2 \, a{\left (\cos \left (f x + e\right ) - 1\right )}}{\cos \left (f x + e\right ) + 1} - \frac{2 \, b{\left (\cos \left (f x + e\right ) - 1\right )}}{\cos \left (f x + e\right ) + 1} + \frac{a{\left (\cos \left (f x + e\right ) - 1\right )}^{2}}{{\left (\cos \left (f x + e\right ) + 1\right )}^{2}} + \frac{b{\left (\cos \left (f x + e\right ) - 1\right )}^{2}}{{\left (\cos \left (f x + e\right ) + 1\right )}^{2}}\right )}{a} - \frac{2 \, \log \left (-\frac{\cos \left (f x + e\right ) - 1}{\cos \left (f x + e\right ) + 1} + 1\right )}{a}}{2 \, f} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(tan(f*x+e)/(a+b*sec(f*x+e)^2),x, algorithm="giac")

[Out]

-1/2*(log(a + b + 2*a*(cos(f*x + e) - 1)/(cos(f*x + e) + 1) - 2*b*(cos(f*x + e) - 1)/(cos(f*x + e) + 1) + a*(c
os(f*x + e) - 1)^2/(cos(f*x + e) + 1)^2 + b*(cos(f*x + e) - 1)^2/(cos(f*x + e) + 1)^2)/a - 2*log(-(cos(f*x + e
) - 1)/(cos(f*x + e) + 1) + 1)/a)/f